//连接数据库
var mongoose = require("mongoose");
mongoose.set('useFindAndModify', false);//消除警告
// mongoose.set('debug', true);//设置debug模式
mongoose.connect('mongodb://localhost:27017/range', {useNewUrlParser: true, config: { autoIndex: false } });

var db = mongoose.connection;

module.exports = db;